package com.ims.DAO;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;

import com.ims.hibernate.IngramData;
import com.ims.hibernate.Student;
import com.ims.hibernate.SynexData;
import com.ims.util.HibernateUtil;



public class SynexDataDAO {
	public static void main(String[] args) {
		SynexDataDAO synex = new SynexDataDAO();
		
	Long a =	synex.saveIngramData( "abc",  "abc",  "abc",  "abc",  "abc",  "abc",  "abc", "abc",  "abc",  "abc",  "abc",  "abc",  "abc",  "abc", "abc",  "abc",  "abc",  "abc",  "abc",  "abc",  "abc", "abc",  "abc",  "abc",  "abc",  "abc");
	}
	
	public Long saveIngramData(String abcCode, String contractPrice, String detailRecordId, String educationalPrice, String etaDate, String federalGovPrice, String govClass
			,String gsaNtePrice, String gsaPricing, String height, String kitStandAloneFlag, String length, String longDesc1, String longDesc2,//
			String productLength, String productWidth, String restrictedFlag, String retailPrice, String skuStatus, String specialPriceFlag, String substitutePartNumber,
			String uCPCode, String vendorNo, String vendorPartNo, String weight, String vender_name)
	{
		Session session = HibernateUtil.getSessionFactory().openSession();
		Transaction transaction = null;
		Long p = null;
		
		try {
			transaction = session.beginTransaction();
			SynexData synexData = new SynexData();
			/*
			synexData.setAbcCode(abcCode);
			synexData.setContractPrice(contractPrice);
			synexData.setDetailRecordId(detailRecordId);
			synexData.setEducationalPrice(educationalPrice);
			synexData.setEtaDate(etaDate);
			synexData.setFederalGovPrice(federalGovPrice);
			synexData.setGovClass(govClass);
			synexData.setGsaNtePrice(gsaNtePrice);
			synexData.setGsaPricing(gsaPricing);
			synexData.setHeight(height);
			synexData.setKitStandAloneFlag(kitStandAloneFlag);
			synexData.setLength(length);
			synexData.setLongDesc1(longDesc1);
			synexData.setLongDesc2(longDesc2);
			synexData.setLongDesc3(longDesc3);
			synexData.setManufacturePartNo(manufacturePartNo);
			synexData.setManufacturerName(manufacturerName);
			synexData.setMediaType(mediaType);
			synexData.setMgfDropShip(mgfDropShip);
			synexData.setMinimumOrderQty(minimumOrderQty);
			synexData.setMsrpmsrp(msrpmsrp);
			synexData.setParcelShippable(parcelShippable);
			synexData.setPartDescription(partDescription);
			synexData.setPlatformType(platformType);
			synexData.setProductDescFr(productDescFr);
			synexData.setPromotionalComment(promotionalComment);
			synexData.setPromotionalFlag(promotionalFlag);
			synexData.setPromotionExpiration_date(promotionExpiration_date);
			synexData.setPurchasingRequirement(purchasingRequirement);
			synexData.setQtyHandTotal(qtyHandTotal);
			synexData.setReplacementSku(replacementSku);
			synexData.setReturnableFlag(returnableFlag);
			synexData.setSerializedFlag(serializedFlag);
			synexData.setShipWeight(shipWeight);
			synexData.setSkuAttributes(skuAttributes);
			synexData.setSkuCreatedDate(skuCreatedDate);
			synexData.setStateGovPrice(stateGovPrice);
			synexData.setStatusCodes(statusCodes);
			synexData.setSynexCatCode(synexCatCode);
			synexData.setSynexInternal(synexInternal);
			synexData.setSynexInternalAssignUse(synexInternalAssignUse);
			synexData.setSynexInternalUse(synexInternalUse);
			synexData.setSynexInternalUseCaCustomer(synexInternalUseCaCustomer);
			synexData.setSynexInternalUseCaOrders(synexInternalUseCaOrders);
			synexData.setSynexInternalVpicode(synexInternalVpicode);
			synexData.setSynexReserve56(synexReserve56);
			synexData.setSynexReserve62(synexReserve62);
			synexData.setSynexReserve63(synexReserve63);
			synexData.setSynexReserve64(synexReserve64);
			synexData.setSynexReserveLas(synexReserveLas);
			synexData.setSynexReserveUse(synexReserveUse);
			synexData.setSynexReserveUseIndustry(synexReserveUseIndustry);
			synexData.setSynexSku(synexSku);
			synexData.setTaaFlag(taaFlag);
			synexData.setTradingPartnerCode(tradingPartnerCode);
			synexData.setUnitPrice(unitPrice);
			synexData.setUnspscCode(unspscCode);
			synexData.setUpcCode(upcCode);
			synexData.setWarehouseQtyBeaverton(warehouseQtyBeaverton);
			synexData.setWarehouseQtyChantilly(warehouseQtyChantilly);
			synexData.setWarehouseQtyChicago(warehouseQtyChicago);
			synexData.setWarehouseQtyColumbus(warehouseQtyColumbus);
			synexData.setWarehouseQtyFremont(warehouseQtyFremont);
			synexData.setWarehouseQtyHandMiami(warehouseQtyHandMiami);
			synexData.setWarehouseQtyNj(warehouseQtyNj);
			synexData.setWarehouseQtyNorcross(warehouseQtyNorcross);
			synexData.setWarehouseQtyOlive(warehouseQtyOlive);
			synexData.setWarehouseQtyOntario(warehouseQtyOntario);
			synexData.setWarehouseQtyTx(warehouseQtyTx);
			*/
			
			//session.save(ingramData);
			transaction.commit();
		} catch (HibernateException e) {
			transaction.rollback();
			e.printStackTrace();
		} finally {
			session.close();
		}
		return p;
	}
	


}
